﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Frontend/Frontend.Master" Inherits="System.Web.Mvc.ViewPage<IntroduceCompany.ProductListView>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Tên sản phẩm
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<% if (Model != null)
   { %>
    <table border="0" cellpadding="0" cellspacing="0" width="100% ;">
        <tr>
            <td class="col-left bg_product">
                <% Html.RenderPartial("/Views/Frontend/Product/Left.ascx"); %>
            </td>
            <td class="col-center">
            <% if (Model != null)
               { %>

                <div class="productdetails">
                    <h2><%= Html.Encode(Model.ProductName)%></h2>
                    <div class="content">
                        <div class="content_fl">
                            <div class="content_gallery">
                                <div id="gallery">
                                    <div id="slides">

                                    <% foreach (var item in ViewData["ProductImages"] as IQueryable<IntroduceCompany.ProductImage>)
                                       { %>
                                       <div class="slide"><img src="../../../Image/Product/<%= item.ProductImageName %>" alt="side" title="<%= item.ProductImageName %>" /></div>
                                    <%} %>
                                       
                                    </div>
    
                                    <div id="img_thumb">
                                        <ul>
                                          <% foreach (var item in ViewData["ProductImages"] as IQueryable<IntroduceCompany.ProductImage>)
                                             { %>
                                           <li class="menuItem"><a href=""><img src="../../../Image/Product/thumbnail/<%= item.ProductImageName %>" alt="thumbnail" /></a></li>
                                         <%} %>
                                        </ul>
                                    </div>
                                 </div>
                            </div>
                            <div class="bg_shadow"></div>
                        </div>
                        <h3><%= Html.Encode(Model.ProductName)%></h3>
                        <p><%= IntroduceCompany.Resources.Resx.Frontend_Product_ProductDetail_lab_Brief%><br /><br /><span style="font-weight:bold;">Tel:  08-2229-1783 Hotline: 0916.06.1783. YM: yummy21vn</span></p>
                        <div class="info">
                            <div class="info_fl">
                                <p><%= IntroduceCompany.Resources.Resx.Frontend_Product_ProductDetail_lab_ProductCode%></p>
                                <p><%= IntroduceCompany.Resources.Resx.Frontend_Product_ProductDetail_lab_ProductStatus%></p>
                                <p><%= IntroduceCompany.Resources.Resx.Frontend_Product_ProductDetail_lab_ViewNumber%></p>
                            </div>
                            <div class="info_fr">
                                <p>: <span class="bold"><%= Html.Encode(Model.ProductID)%></span></p>
                                <p>: <%= Html.Encode(Model.ProductStatusName)%></p>
                                <p>: <%= Html.Encode(Model.ViewNumber)%></p>
                            </div><br class="clear"/>
                            <p class="info_price"><%= IntroduceCompany.Resources.Resx.Frontend_Product_ProductDetail_lab_Price%>: <span><%= Html.Encode(Model.ProductPrice.ToString("N0", System.Globalization.CultureInfo.CreateSpecificCulture("vi-VN")))%> VNĐ</span></p>
                        </div>
                        <% //Product is only ordered when product status is stocking
    if (Model.ProductStatusID == 1)
    {%>
                        <div class="orders">
                            <div class="f_order">
                                <label><%= IntroduceCompany.Resources.Resx.Frontend_Product_ProductDetail_lab_Quantity%>:</label>

                                <%  //Put product into Cart
    using (Html.BeginForm("PutProductIntoCart", "Order", FormMethod.Post))
    {%>
                                <%= Html.AntiForgeryToken(IntroduceCompany.Util.AntiKey.EditSalt)%>
                                <%= Html.ValidationSummary(true)%>
                                <input type="text" value="1" id="quantity" name="quantity" class="inputbox" maxlength="4" />
                                <%= Html.Hidden("productID", Model.ProductID)%>


                                    <input type="submit" value="" class="button" /> 
                                    <%} %>
                       <%} %>

                            </div>
                        </div><br class="clear"/>
                        <div class="content_middle">
                            <div class="description">
                            <h3><%= IntroduceCompany.Resources.Resx.Frontend_Product_ProductDetail_lab_Description%>:</h3>
                                <%= Model.ProductDescription%>
                            </div>
                        </div>

                        <%  string[] roleList = IntroduceCompany.Util.ConstantClass.autProduct.Split(',');
                            foreach (string roleID in roleList)
                            {
                                if (Context.User.IsInRole(roleID))
                                { %>
                        <div>
                        <a href="<%= Url.Action("ProductEdit","Product", new { productID = Model.ProductID, productLanguageID = Model.ProductLanguageID }) %>">
                           Chỉnh sửa sản phẩm</a>
                        </div>
                        <%         break;
                                }
                            }%>
                    </div>
                </div>

             <%}
               else
               { %>

               <br class="clear"/>
               <p class="red txt_fc"><%= IntroduceCompany.Resources.Resx.Frontend_Product_ProductDetail_lab_NoticeNoProduct%></p>
               <br class="clear"/>

              <%} %>

            </td>
        </tr>
    </table>

<%} %>
</asp:Content>
